from pydantic import BaseModel, ConfigDict

from apps.system.schemas import UserMiniOut
from core.data_types import DatetimeStr


class Caselib(BaseModel):
    name: str
    desc: str | None = None
    create_user_id: int | None = None


class CaselibSimpleOut(Caselib):
    model_config = ConfigDict(from_attributes=True)

    id: int
    create_time: DatetimeStr
    update_time: DatetimeStr
    create_user: UserMiniOut


class CaselibFollowIn(BaseModel):
    caselib_id: int
    follow: bool
